---
title: "Media experiment final"
date: "2026-01-08"
output:
  pdf_document: default
  html_document: default
---


```{r}

# MAIN TEXT

# 1. INSTALLATION AND LOADING OF PACKAGES
# 2. DATA PREPARATION
# 3. RENAMING AND RECODING OF VARIABLES
# 4. RECODING OUTCOME VARIABLES
# 5. CONSTRUCTING POLITICAL ENGAGEMENT INDEX
# 6. DESCRIPTIVE STATISTICS: FIGURE 4 IN THE MAIN TEXT
# 7. CREATING VARIABLES FOR THE EXPERIMENT 
# 8. CREATING SEPARATE DATASETS FOR EACH TREATMENT
# 9. CREATING SEPARATE DATASETS BASED ON PARTISANSHIP
# 10. THE DATASET FOR THE WAR-FOCUSED ANTI-REGIME DEBUNKING ITEM
# 11. CREATING SEPARATE DATASETS FOR WAR-FOCUSED AND ECONOMY-FOCUSED MESSAGES
# 12. EXPERIMENT -- PARTISANSHIP AND CREDIBILITY: Table A.1.1 IN THE APPENDIX
# 13. CREDIBILITY AND PARTISANSHIP DESCRIPTIVE STATISTICS: TABLE 1 IN THE MAIN TEXT
# 14. CREDIBILITY AND PARTISANSHIP: FIGURE 5 IN THE MAIN TEXT
# 15. EXPERIMENT -- CREDIBILITY: FIGURE 6 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX
# 16. MEDIA TRUST -- DESCRIPTIVE STATISTICS: TABLE 2 IN THE MAIN TEXT
# 17. EXPERIMENT -- OFFLINE MEDIA TRUST: FIGURE 7 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX
# 18. EXPERIMENT -- ONLINE MEDIA TRUST: FIGURE 7 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX
# 19. RESPONSIBILITY ATTRIBUTION -- DESCRIPTIVE STATISTICS: TABLE A3 IN THE MAIN TEXT
# 21. EXPERIMENT -- RESPONSIBILITY ATTRIBUTION: FIGURE 8 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX
# 22. EXPERIMENT -- RESPONSIBILITY ATTRIBUTION BY PARTISANSHIP: FIGURE 9 IN THE MAIN TEXT AND TABLE A3 IN THE APPENDIX
# 23. WAR VS ECONOMY -- CREDIBILITY: Z-VALUES for P.22-33 and TABLE A4 IN THE APPENDIX
# 24. WAR VS ECONOMY -- RESPONSIBILITY Z-VALUES for P.22-33 and TABLE A4 IN THE APPENDIX

# APPENDIX 

# APPENDIX A

# A1. PROPA EXPERIMENT -- MEDIA TRUST: FIGURE A1 and TABLE A5 IN THE APPENDIX
# A2. BACKFIRE EFFECT: FIGURE A2 and TABLE A6 IN THE APPENDIX
# A3. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK (BACKFIRING): FIGURE A3 and TABLE A7 IN THE APPENDIX
# A4. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK 1 (RESPONSIBILITY): FIGURE A4 and TABLE A8 IN THE APPENDIX
# A5. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK 2 (PARTY SUPPORT): FIGURE A5 and TABLE A9 IN THE APPENDIX
# A6. ROBUSTNESS -- HETEROGENEOUS EFFECTS OF DEBUNKING ON CREDIBILITY: TABLE A10 IN THE APPENDIX

# APPENDIX B

# B1. BALANCE CHECK: FIGURE B2 IN THE APPENDIX 
# B2. PROCESSING TASK: FIGURE B3 IN THE APPENDIX
# B3. POWER ANALYSIS: FIGURE B9 IN THE APPENDIX

# APPENDIX C

# C1. SOCIO-DEMOGRAPHIC CHARACTERISTICS: TABLE C1 IN THE APPENDIX 
# C2. REGIONAL VARIATION: TABLE C2 IN THE APPENDIX


```

```{r}
# START LOG 
log_file <- "log.txt"
log_con  <- file(log_file, open = "wt")  

on.exit({
  try(sink(type = "message"), silent = TRUE)
  try(sink(type = "output"),  silent = TRUE)
  try(close(log_con),         silent = TRUE)
}, add = TRUE)

options(warn = 1)  

sink(log_con, type = "output",  split = TRUE) 
sink(log_con, type = "message")                

cat("=== LOG START ===\n")
cat("Time: ", format(Sys.time()), "\n", sep = "")
cat("Working directory: ", getwd(), "\n\n", sep = "")
flush(log_con)
```

```{r pressure, echo=FALSE}

# 1. INSTALLATION AND LOADING OF PACKAGES

library(dplyr)
library(haven)
library(pwr)
library(sjPlot)
library(psych)
library(cregg)
library(ggpubr)
library(stringr)
library(cowplot)
library(ggplot2)
library(grid)


```

```{r setup, include=FALSE}

# 2. DATA PREPARATION

# Improting the dataset from the SPSS file downloaded from Qualtrics. Including only residents of Russia and those who reached the last item and completed the survey. Including only subjects who saw war-related and economy-related stories.

df <- read_sav("media.sav") %>% 
  haven::as_factor() %>%
  filter(Progress > 50, Q8 %in% "Россия", Q44 %in% "Да") %>%
  filter(GROUP %in% 0:4 | GROUP %in% 7:10)

```

```{r cars}

# 3. RENAMING AND RECODING OF VARIABLES IN THE DATASET

# Assigning meaningful names to variables.

df = df %>% 
           rename("age" ="Q6_",
                  "region" = "Q9",
                  "settlement_type" = "Q10_",
                  "children" = "Q13",
                  "income_subj" = "Q14",
                  "income_obj" = "Q15",
                  "edu" = "Q16",
                  "empl" = "Q17",
                  "office" = "Q18_1" ,
                  "culture" = "Q18_2" ,
                  "education" = "Q18_3" ,
                  "media" = "Q18_4" ,
                  "marketing" = "Q18_5" ,
                  "services" = "Q18_6" ,
                  "trade" = "Q18_7" ,
                  "industry" = "Q18_8" ,
                  "healthcare" = "Q18_9" ,
                  "govnt" = "Q18_10" ,
                  "IT" = "Q18_11" ,
                  "engineer" = "Q18_12" ,
                  "transport" = "Q18_13" ,
                  "agriculture" = "Q18_14" ,
                  "other" = "Q18_15"  ,
                  "news_follow" = "Q19" ,
                  "federal_channels" = "Q20_1" ,
                  "radio" = "Q20_2" ,
                  "online" = "Q20_3" ,
                  "soc_media" = "Q20_4" ,
                  "search" = "Q20_5" ,
                  "youtube" = "Q20_6" ,
                  "friends" = "Q20_7" ,
                  "media_trust" = "Q21" ,
                  "federal_channels_num" = "Q22_1" ,
                  "radio_num" = "Q22_2" ,
                  "soc_media_num" = "Q22_12"  ,
                  "online_num" = "Q22_3" ,
                  "search_num" = "Q22_4"  ,
                  "youtube_num" = "Q22_5" ,
                  "others_num" = "Q22_6" ,
                  "interested_politics" = "Q23" ,
                  "discuss_politics" = "Q24"  ,
                  "voted_2021" = "Q25" ,
                  "SD_party" = "Q26" ,
                  "putin_support" = "Q27" ,
                  "queues" = "Q28_1" ,
                  "boycott" = "Q28_2"  ,
                  "violence" = "Q28_3" ,
                  "vote_freq" = "Q29"  ,
                  "civic_duty" = "Q30_1"  ,
                  "noonthervotes" = "Q30_2" ,
                  "habit" =  "Q30_3" ,
                  "polit_position" = "Q30_4"  ,
                  "party_cand_support" = "Q30_5" ,
                  "peer_pressure" = "Q30_6"  ,
                  "asked_to_vote" = "Q30_7"  ,
                  "punish" = "Q30_8" ,
                  "other_reason_to_vote" = "Q30_9"  ,
                  "trad_media" = "Q85" ,
                  "new_media" = "Q86" ,
                  "vote_for_future" = "Q36"  ,
                  "UR_support" = "Q37"  ,
                  "russia_blame" = "Q38_1" ,
                  "UA_blame" = "Q38_2"  ,
                  "west_blame" = "Q38_3"  ,
                  "blurred_blame" = "Q38_4" ,
                  "trustworthy1" = "Q32",
                  "trustworthy2" = "Q33",
                  "trustworthy3" = "Q83",
                  "check1" = "Q87" ,
                  "check2" = "Q88",
                  "check3" = "Q89",
                  "gender" = "Q7",
                   "marital" = "Q11")


```

```{r pressure, echo=FALSE}

# 4. RECODING OUTCOME VARIABLES

# Credibility of news items in control and treatment groups as well as debunking items. Completely trustworthy = 4; Somewhat trustworthy = 3; Somewhat untrustworthy = 2; Completely untrustworthy = 1

df = df %>%
    mutate(trustworthy1_num = case_when(
      trustworthy1 == "Полностью достоверной" ~ 4,
      trustworthy1 == "Скорее достоверной" ~ 3,
      trustworthy1 == "Скорее недостоверной" ~ 2,
      trustworthy1 =="Полностью недостоверной" ~ 1,
    ))

df = df %>%
    mutate(trustworthy2_num = case_when(
      trustworthy2 == "Полностью достоверным" ~ 4,
      trustworthy2 == "Скорее достоверным" ~ 3,
      trustworthy2 == "Скорее недостоверным" ~ 2,
      trustworthy2 =="Полностью недостоверным" ~ 1,
    ))

df = df %>%
    mutate(trustworthy3_num = case_when(
      trustworthy3 == "Полностью достоверным" ~ 4,
      trustworthy3 == "Скорее достоверным" ~ 3,
      trustworthy3 == "Скорее недостоверным" ~ 2,
      trustworthy3 =="Полностью недостоверным" ~ 1,
    ))

# Merging trustworthy1_num and trustworthy2_num to create a credibility variable for all groups trustworthy_combined.

df$trustworthy_combined <- paste(as.numeric(df$trustworthy1_num), as.numeric(df$trustworthy2_num), sep = "")

df$trustworthy_combined <- gsub("[NA]", "", df$trustworthy_combined)
df$trustworthy_combined <- as.numeric(df$trustworthy_combined)

# Trust in offline and online media. Completely trust = 4; Somewhat trust = 3; Somewhat distrust = 2; Completely distrust = 1

df <- df %>%
  mutate(trad_num = case_when(trad_media == "Полностью доверяю" ~ 4,
                          trad_media == "Скорее доверяю" ~ 3,
                          trad_media == "Скорее не доверяю" ~ 2,
                          trad_media == "Полностью не доверяю" ~ 1
                          ))

df <- df %>%
  mutate(new_num = case_when(new_media == "Полностью доверяю" ~ 4,
                          new_media == "Скорее доверяю" ~ 3,
                          new_media == "Скорее не доверяю" ~ 2,
                          new_media == "Полностью не доверяю" ~ 1
                          ))

# Blame attribution. Transforming 0-10 scales to make them equivalent to the ones used for the evaluation of credibility (1-4). 10,9 (completely agree) = 2; 8,7,6 (somewhat agree) = 1; 5 (not sure) = 0; 4,3,2 (somewhat disagree) = -1; 1,0 (completely disagree) = -2

df <- df %>%
    mutate(russia_blame = case_when(
        russia_blame == 10 | russia_blame == 9  ~ 2,
        russia_blame == 8 | russia_blame == 7 | russia_blame == 6 ~ 1,
        russia_blame == 5 ~ 0,
        russia_blame == 4 | russia_blame == 3 | russia_blame == 2 ~ -1,
        russia_blame == 1 | russia_blame == 0 ~ -2,
    ))

df <- df %>%
    mutate(UA_blame = case_when(
        UA_blame == 10 | UA_blame == 9  ~ 2,
        UA_blame == 8 | UA_blame == 7 | UA_blame == 6 ~ 1,
        UA_blame == 5 ~ 0,
        UA_blame == 4 | UA_blame == 3 | UA_blame == 2 ~ -1,
        UA_blame == 1 | UA_blame == 0 ~ -2,
    ))

df <- df %>%
    mutate(west_blame = case_when(
        west_blame  == 10 | west_blame  == 9  ~ 2,
        west_blame  == 8 | west_blame  == 7 | west_blame  == 6 ~ 1,
        west_blame  == 5 ~ 0,
        west_blame  == 4 | west_blame  == 3 | west_blame  == 2 ~ -1,
        west_blame  == 1 | west_blame  == 0 ~ -2,
    ))

df <- df %>%
    mutate(blurred_blame = case_when(
        blurred_blame == 10 | blurred_blame == 9  ~ 2,
        blurred_blame == 8 | blurred_blame == 7 | blurred_blame == 6 ~ 1,
        blurred_blame == 5 ~ 0,
        blurred_blame == 4 | blurred_blame == 3 | blurred_blame == 2 ~ -1,
        blurred_blame == 1 | blurred_blame == 0 ~ -2,
    ))

# Education. From text data to numeric values. College degree - 6; Unfinished college degree - 5; Secondary vocational training - 4; Primary vocational training - 3; High school (11 grades) - 2; Middle school (9 grades) - 1

df <- df %>%
    mutate(edu = case_when(
           edu == "Высшее" ~ 6,
           edu == "Неоконченное высшее (не менее 3-х курсов вуза)" ~ 5,
           edu == "Среднее профессиональное образование" ~ 4,
           edu == "Начальное профессиональное образование" ~ 3,
           edu == "Средняя школа (10, сейчас 11 классов)" ~ 2,
           edu == "Начальное или ниже, неполная средняя школа (7-8, сейчас 9 классов)" ~ 1
           ))

# Settlement type. 


df <- df %>%
    mutate(settlement_type = case_when(
      settlement_type == "Город" ~ 'City',
      settlement_type == "Село" ~ 'Town',
      settlement_type == "Поселок городского типа" ~ 'Urban-type settlement',
      settlement_type == "Деревня" ~ 'Village',
      settlement_type == "Затрудняюсь ответить" ~ 'difficult to answer',
           ))

# Gender. From text data to numeric values. Male  = 1, Female = 0.

df <- df %>%
    mutate(gender = case_when(
          gender == "Мужской" ~ 1,
          gender == "Женский" ~ 0
          ))
 
df$gender <- as.numeric(df$gender)

# Interest in news

df <- df %>%
  mutate(news_follow = case_when
                (news_follow == "Очень активно" ~ "very actively",
                news_follow == "Активно" ~ "actively",
                news_follow == "Не очень активно" ~ "not very actively",
                news_follow == "Не слежу" ~ "do not follow",
                news_follow == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))
# Interest in politics

df <- df %>%
  mutate(interested_politics = case_when
        (interested_politics == "Очень интересна" ~ "very interested",
        interested_politics == "Скорее интересна" ~ "somewhat interested",
        interested_politics == "Скорее не интересна" ~ "not that interested",
        interested_politics == "Совсем не интересна" ~ "not interested",
        interested_politics == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))
# Political discussions

df <- df %>%
  mutate(discuss_politics = case_when
        (discuss_politics == "Очень часто" ~ "very often",
        discuss_politics == "Скорее часто" ~ "often",
        discuss_politics == "Скорее редко" ~ "rarely",
        discuss_politics == "Очень редко" ~ "very rarely",
        discuss_politics == "Никогда" ~ "never",
        discuss_politics == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))

# Frequency of voting

df <- df %>%
  mutate(vote_freq = case_when
        (vote_freq == "Всегда голосую" ~ "always",
        vote_freq == "Чаще всего голосую" ~ "often",
        vote_freq == "Иногда голосую" ~ "sometimes",
        vote_freq == "Редко голосую" ~ "rarely",
        vote_freq == "Не хожу на выборы" ~ "do not vote",
        vote_freq == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))
# Media trust

df <- df %>%
  mutate(media_trust = case_when
        (media_trust == "Полностью доверяю" ~ "completely trust",
        media_trust == "Скорее доверяю" ~ "somewhat trust",
        media_trust == "Скорее не доверяю" ~ "somewhat distrust",
        media_trust == "Полностью не доверяю" ~ "completely distrust",
        media_trust == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))

#  Party support I 

df <- df %>%
  mutate(SD_party = case_when
        (SD_party == "\"Единая Россия\"" ~ "United Russia",
        SD_party == "КПРФ" ~ "CPRF",
        SD_party == "\"Справедливая Россия – За правду\"" ~  "Just Russia",
        SD_party == "ЛДПР" ~ "LDPR",
        SD_party == "\"Новые люди\"" ~ "New People",
        SD_party == "Никакую не поддерживаю" ~ "none",
        SD_party == "Затрудняюсь ответить" ~ "difficult to answer"
                          ))


#  Party support II

df <- df %>%
  mutate(UR_support = case_when
        (UR_support == "Да" ~ "Yes",
        UR_support == "Нет" ~ "No",
        UR_support == "Затрудняюсь ответить" ~  "Not sure"
        ))


# Interest in news. From text data to numeric values.

df <- df %>%
  mutate(news_follow_num = case_when
                        (news_follow == "very actively" ~ 4,
                          news_follow == "actively" ~ 3,
                          news_follow == "not very actively" ~ 2,
                          news_follow == "do not follow" ~ 1
                          ))

# Interest in politics. From text data to numeric values.

df <- df %>%
  mutate(interested_politics_num = case_when
                        (interested_politics == "very interested" ~ 4,
                          interested_politics  == "somewhat interested" ~ 3,
                          interested_politics  == "not that interested" ~ 2,
                          interested_politics  == "not interested" ~ 1
                          ))

df <- df %>%
  mutate(discuss_politics_num = case_when
                        (discuss_politics == "very often" ~ 5,
                          discuss_politics  == "often" ~ 4,
                          discuss_politics  == "rarely" ~ 3,
                          discuss_politics  == "very rarely" ~ 2,
                          discuss_politics == "never" ~ 1
                          ))

# Support for the president.

df$putin_support <- recode(df$putin_support, "Одобряю" = 'Supporters', 
                                       "Не одобряю" = 'Critics',
                                       "Затрудняюсь ответить" = 'Undecided')

```

```{r pressure, echo=FALSE}

# 5. CONSTRUCTING POLITICAL ENGAGEMENT INDEX

# Used as control in the OLS regressions alongside age, gender, and education

# Creating the matrix (subset) with numeric versions of variables.

index_engage <- df %>%
  filter(!is.na(news_follow)) %>%
  dplyr::select(news_follow_num, interested_politics_num, discuss_politics_num)

# Principal component analysis.

PCA_results1 <- principal(index_engage, nfactors = 1)

# Principal component analysis scores are turned into an index.

df$index_engage <- PCA_results1$scores 

engagement_cor <- cor(index_engage, use='pairwise.complete.obs', method = "spearman")

list(engagement_cor, PCA_results1)

```

```{r pressure, echo=FALSE}

# 6. DESCRIPTIVE STATISTICS: FIGURE 4 IN THE MAIN TEXT

# Interest in news.

custom_order_news <- c("very actively", "actively", "not very actively", "do not follow", "difficult to answer")
custom_order_news <- rev(custom_order_news)
df$news_follow <- factor(df$news_follow, levels = custom_order_news, ordered = TRUE)
response_percentages_news <- prop.table(table(df$news_follow)) * 100
response_percentages_news_df <- as.data.frame(response_percentages_news)
colnames(response_percentages_news_df) <- c("Response", "Percentage")
news_follow <- ggplot(response_percentages_news_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Interest in news",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Interest in politics 

custom_order_pol_interest <- c("very interested", "somewhat interested", "not that interested", "not interested", "difficult to answer")
custom_order_pol_interest <- rev(custom_order_pol_interest)
df$interested_politics <- factor(df$interested_politics, levels = custom_order_pol_interest, ordered = TRUE)
response_percentages_pol_interest <- prop.table(table(df$interested_politics )) * 100
response_percentages_pol_interest_df <- as.data.frame(response_percentages_pol_interest)
colnames(response_percentages_pol_interest_df) <- c("Response", "Percentage")
political_interest <- ggplot(response_percentages_pol_interest_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Interest in politics",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Political discussions

custom_order_dis <- c("very often", "often", "rarely", "very rarely", "never", "difficult to answer")
custom_order_dis <- rev(custom_order_dis)
df$discuss_politics <- factor(df$discuss_politics, levels = custom_order_dis, ordered = TRUE)
response_percentages_dis <- prop.table(table(df$discuss_politics)) * 100
response_percentages_dis_df <- as.data.frame(response_percentages_dis)
colnames(response_percentages_dis_df) <- c("Response", "Percentage")
political_discussion <- ggplot(response_percentages_dis_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Political discussions",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +  
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Voting

custom_order_vote <- c("always", "often", "sometimes", "rarely", "do not vote", "difficult to answer")
custom_order_vote <- rev(custom_order_vote)
df$vote_freq <- factor(df$vote_freq , levels = custom_order_vote, ordered = TRUE)
response_percentages_vote <- prop.table(table(df$vote_freq )) * 100
response_percentages_vote_df <- as.data.frame(response_percentages_vote)
colnames(response_percentages_vote_df) <- c("Response", "Percentage")
voting <- ggplot(response_percentages_vote_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Frequency of voting",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Media trust

custom_order_trust <- c("completely trust", "somewhat trust", "somewhat distrust", "completely distrust", "difficult to answer")
custom_order_trust <- rev(custom_order_trust)
df$media_trust <- factor(df$media_trust, levels = custom_order_trust, ordered = TRUE)
response_percentages_trust <- prop.table(table(df$media_trust)) * 100
response_percentages_trust_df <- as.data.frame(response_percentages_trust)
colnames(response_percentages_trust_df) <- c("Response", "Percentage")
media_trust <- ggplot(response_percentages_trust_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Media trust",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Mean media trust by source. 

means <- c(mean(df$federal_channels_num, na.rm = TRUE),
           mean(df$online_num, na.rm = TRUE),
           mean(df$soc_media_num, na.rm = TRUE), 
           mean(df$others_num, na.rm = TRUE))
colnames <- c('tv', 'online media', 'social media', 'others')
media_means <- data_frame(colnames, means)
trust_by_source <- ggplot(media_means, aes(x = means, y = colnames)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Mean trust by source",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 10)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Support for Putin.

df$putin_support2 <- df$putin_support

df$putin_support2 <- recode(df$putin_support2,
                            'Supporters' = 'approve', 
                            'Critics' = 'disapprove',
                            'Undecided' = 'difficult to answer')

custom_order_putin <- c("difficult to answer", "disapprove", "approve")

df$putin_support2 <- factor(df$putin_support2 , levels = custom_order_putin)

response_percentages_putin <- prop.table(table(df$putin_support2)) * 100
response_percentages_putin_df <- as.data.frame(response_percentages_putin)
colnames(response_percentages_putin_df) <- c("Response", "Percentage")
putin_support <- ggplot(response_percentages_putin_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Support for Putin",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) + 
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )

# Support for parties

custom_order_party <- c("United Russia", "CPRF", "LDPR", "Just Russia", "New People", "none", "difficult to answer")
custom_order_party <- rev(custom_order_party)
df$SD_party <- factor(df$SD_party , levels = custom_order_party)
response_percentages_party <- prop.table(table(df$SD_party )) * 100
response_percentages_party_df <- as.data.frame(response_percentages_party)
colnames(response_percentages_party_df) <- c("Response", "Percentage")
party_support <- ggplot(response_percentages_party_df, aes(x = Percentage, y = Response)) +
  geom_bar(stat = "identity", fill = "black") +
  labs(
    title = "Party support",
    x = " ",
    y = " "
  ) + scale_x_continuous(limits = c(0, 100)) +
  theme_minimal()+
  theme(plot.title = element_text(hjust = 0.5))+ 
  theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 25), 
    axis.title.y = element_text(size = 20),   
    axis.text.x  = element_text(size = 21),   
    axis.text.y  = element_text(size = 25),   
    legend.title = element_text(size = 21),   
    legend.text  = element_text(size = 19.5)  
  )


# Merging all graphs 

descriptive <- ggarrange(news_follow, political_interest,
                         political_discussion, voting,
                         media_trust, trust_by_source,
                         putin_support, party_support,
                         ncol = 2, nrow = 4,
                         align = "v",
                         heights = c(.3,.35))

descriptive


# Save as Figure 4 with publication-quality resolution (dpi = 600)

ggsave(
  "Figure_4.png",
  plot   = descriptive,
  width  = 10000, height = 8500, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)


```

```{r pressure, echo=FALSE}

# 7. CREATING VARIABLES FOR THE EXPERIMENT 

# Creating 'debunk' variable for exposure to disinformation discourse, 'slant_gov_n' and 'slant_gov_deb' variables for pro-regime or anti-regime framing of news and debunking stories,'topic_n' and 'topic_deb' for war-focused and economy-focused news and debunking stories, and and 'group' for each individual group


df <- df %>%
  mutate(
    debunk = factor(case_when(
      GROUP %in% 1:4 ~ 0,
      GROUP %in% 7:10 ~ 1
    ), levels = c(0, 1), labels = c("news", "debunking")))


df = df %>%
    mutate(slant_gov_n = case_when(
      GROUP == 2 | GROUP == 4  ~ 'pro-regime',
      GROUP == 1 | GROUP == 3  ~ 'anti-regime'
    ))


df = df %>%
    mutate(slant_gov_deb = case_when(
      GROUP == 7 | GROUP == 9  ~ 'pro-regime',
      GROUP == 8 | GROUP == 10  ~ 'anti-regime'
    ))

df = df %>%
    mutate(slant_gov_deb2 = case_when(
      GROUP == 8 | GROUP == 10  ~ 'anti-regime',
      GROUP == 7 | GROUP == 9  ~ 'pro-regime'
    ),
    slant_gov_deb2 = factor(slant_gov_deb2, levels = c("pro-regime", "anti-regime"))
    
    )


df = df %>%
    mutate(topic_n = case_when(
      GROUP == 3 | GROUP == 4  ~ 'econ',
      GROUP == 1 | GROUP == 2  ~ 'war'
    ))


df = df %>%
    mutate(topic_deb = case_when(
      GROUP == 9 | GROUP == 10  ~ 'econ',
      GROUP == 7 | GROUP == 8  ~ 'war'
    ))

df <- df %>%
    mutate (group = case_when(
    GROUP == '1' ~ 'war: anti-regime news',
    GROUP == '2' ~ 'war: pro-regime news',
    GROUP == '3' ~ 'econ: anti-regime news',
    GROUP == '4' ~ 'econ: pro-regime news',
    GROUP == '7' ~ 'war: pro-regime debunking',
    GROUP == '8' ~ 'war: anti-regime debunking',
    GROUP == '9' ~ 'econ: pro-regime debunking',
    GROUP == '10' ~ 'econ: anti-regime debunking'
  ))


df$topic_n <- as.factor(df$topic_n)
df$topic_deb <- as.factor(df$topic_deb)
df$slant_gov_n <- as.factor(df$slant_gov_n)
df$slant_gov_deb <- as.factor(df$slant_gov_deb)
df$slant_gov_deb2 <- as.factor(df$slant_gov_deb2)

```

```{r pressure, echo=FALSE}

# 8. CREATING SEPARATE DATASETS FOR EACH TREATMENT

# Creating separate datasets for each debunking story

df_PRDW <- df %>%
  filter (group == 'war: anti-regime news' | group == 'war: pro-regime debunking')  %>%
    mutate (group = case_when(
      group == 'war: anti-regime news' ~ 'news',
      group ==  'war: pro-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))

df_PRDE <- df %>%
  filter (group == 'econ: anti-regime news' | group == 'econ: pro-regime debunking')  %>%
    mutate (group = case_when(
      group == 'econ: anti-regime news' ~ 'news',
      group ==  'econ: pro-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))

df_ARDW <- df %>%
  filter (group == 'war: pro-regime news' | group == 'war: anti-regime debunking' )  %>%
    mutate (group = case_when(
      group == 'war: pro-regime news' ~ 'news',
      group ==  'war: anti-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))

df_ARDE <- df %>%
  filter (group == 'econ: pro-regime news' | group== 'econ: anti-regime debunking')  %>%
    mutate (group = case_when(
      group == 'econ: pro-regime news' ~ 'news',
      group ==  'econ: anti-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))


```

```{r pressure, echo=FALSE}

# 9. CREATING SEPARATE DATASETS BASED ON PARTISANSHIP

# Creating separate datasets based on variables tapping into parisan identity

# Disaggregate by support for Putin

df_pro <- df %>%
    filter (putin_support == 'Supporters')

df_anti <- df %>%
    filter (putin_support == 'Critics')

df_und <- df %>%
    filter (putin_support == 'Undecided')

# Disaggregate by support for United Russia

df_UR <- df %>%
  filter (UR_support == 'Yes') 

df_no_UR <- df %>%
  filter (UR_support == 'No') 

df_ns_UR <- df %>%
  filter (UR_support == 'Not sure') 

# Disaggregate by party support - any party in the parliament, none, difficult to unswer

df_party_pro <- df %>%
    filter (SD_party != 'none' & SD_party != 'difficult to answer')

df_party_anti <- df %>%
    filter (SD_party == 'none')

df_party_ns <- df %>%
    filter (SD_party == 'difficult to answer')

# Disaggregate by party trust in TV


df_tv <- df %>%
  filter (trad_num == 4 | trad_num == 3)

df_no_tv <- df %>%
  filter (trad_num == 2 | trad_num == 1)

df_tv_ns <- df %>%
  filter (trad_num == is.na(NA))

```

```{r pressure, echo=FALSE}

# 10. THE DATASET FOR THE WAR-FOCUSED ANTI-REGIME DEBUNKING ITEM

# Creating separate datasets based on variables tapping into partisan identity for one treatment item: war-focused anti-regime debunking item

# Disaggregate by support for Putin

df_ARDW_pro <- df_ARDW %>%
  filter (putin_support == 'Supporters')

df_ARDW_anti <- df_ARDW %>%
  filter (putin_support == 'Critics')

df_ARDW_und <- df_ARDW %>%
  filter (putin_support == 'Undecided')

# Disaggregate by support for UR

df_ARDW_UR <- df_ARDW %>%
  filter (UR_support == 'Yes') 

df_ARDW_no_UR <- df_ARDW %>%
  filter (UR_support == 'No') 

df_ARDW_ns_UR <- df_ARDW %>%
  filter (UR_support == 'Not sure') 

# Disaggregate by parties

df_ARDW_party_pro <- df_ARDW %>%
    filter (SD_party != 'none' & SD_party != 'difficult to answer')

df_ARDW_party_anti <- df_ARDW %>%
    filter (SD_party == 'none')

df_ARDW_party_ns <- df_ARDW %>%
    filter (SD_party == 'difficult to answer')

# Disaggregate by trust in TV

df_ARDW_tv <- df_ARDW %>%
  filter (trad_media == 'Полностью доверяю' | trad_media == 'Cкорее доверяю')

df_ARDW_no_tv <- df_ARDW %>%
  filter (trad_media == 'Полностью не доверяю' | trad_media == 'Cкорее не доверяю')

df_ARDW_tv_ns <- df_ARDW %>%
  filter (trad_media == 'Затрудняюсь ответить')

```

```{r pressure, echo=FALSE}

# 11. CREATING SEPARATE DATASETS FOR WAR-FOCUSED AND ECONOMY-FOCUSED MESSAGES

df_war <- df %>%
  filter (group == 'war: anti-regime news' | group == 'war: pro-regime news' | group == 'war: pro-regime debunking' | group == 'war: anti-regime debunking')  %>%
    mutate (group = case_when(
      group == 'war: pro-regime news' | group == 'war: anti-regime news'  ~ 'news',
      group ==  'war: anti-regime debunking' | group == 'war: pro-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))

df_ec <- df %>%
  filter (group == 'econ: pro-regime news' | group == 'econ: anti-regime news' | group == 'econ: anti-regime debunking' | group == 'econ: pro-regime debunking')  %>%
    mutate (group = case_when(
      group == 'econ: pro-regime news' | group == 'econ: anti-regime news'  ~ 'news',
      group ==  'econ: anti-regime debunking' | group == 'econ: pro-regime debunking' ~ 'debunking',
      TRUE ~ as.character(group)
    )) %>%
    mutate (group = factor (group, levels = c (
        'news',
        'debunking'
    )))
    
```

```{r pressure, echo=FALSE}

# 12. EXPERIMENT -- PARTISANSHIP AND CREDIBILITY: Table A.1.1 IN THE APPENDIX

# Estimating differences in the credibility of news and debunking items depending on partisanship.

# The effects of interactions between pro-regime or anti-regime framing and support for Putin by topic (war or economy), controlled for political engagement, age, gender, and education (OLS regressions).

df$putin_support <- factor(df$putin_support, levels = c('Undecided', 'Critics', 'Supporters'))

mod1 <- lm(trustworthy_combined ~ slant_gov_n + putin_support*slant_gov_n  + index_engage + age + gender + edu, data = df)

mod2 <- lm(as.numeric(trustworthy3_num) ~ slant_gov_deb + topic_deb + putin_support*slant_gov_deb + + index_engage + age + gender + edu, data = df)

# Table A.1.1 

list(summary(mod1), summary(mod2))

```

```{r pressure, echo=FALSE}

# 13. CREDIBILITY AND PARTISANSHIP DESCRIPTIVE STATISTICS: TABLE 1 IN THE MAIN TEXT


# Credibility - means and standard deviations

df$putin_support2 <- factor(df$putin_support, 
                            levels = c('Supporters', 'Critics', 'Undecided'), 
                            ordered = TRUE)
# News 

df_summary_news <- df %>%
  summarise(mean_n = mean(trustworthy_combined, na.rm = TRUE), SD_n = sd(trustworthy_combined, na.rm = TRUE))

df_summary_news_part <- df %>%
  group_by(putin_support2) %>%
  summarise(mean_n = mean(trustworthy_combined, na.rm = TRUE), SD_n = sd(trustworthy_combined, na.rm = TRUE))

df_cred_news <- df_summary_news_part %>%
    bind_rows(df_summary_news %>% mutate(putin_support2 = "Average"))

# Debunking

df_summary_deb <- df %>%
  summarise(mean_d = mean(trustworthy3_num, na.rm = TRUE), SD_d = sd(trustworthy3_num, na.rm = TRUE))

df_summary_deb_part <- df %>%
  group_by(putin_support2) %>%
  summarise(mean_d = mean(trustworthy3_num, na.rm = TRUE), SD_d = sd(trustworthy3_num, na.rm = TRUE))

df_cred_deb <- df_summary_deb_part %>%
    bind_rows(df_summary_deb %>% mutate(putin_support2 = "Average"))

df_final <- df_cred_news %>%
  left_join(df_cred_deb, by = "putin_support2")


# TABLE 1

df_final
str(df_final)
```

```{r pressure, echo=FALSE}

# 14. CREDIBILITY AND PARTISANSHIP: FIGURE 5 IN THE MAIN TEXT

# Visualising the effects of interactions between pro-regime or anti-regime framing and support for Putin on the credibility of news and debunking items.

credibility_partisanship_1 <- plot_model(
  mod1,
  type = "eff",
  terms = c("putin_support", "slant_gov_n"),
  title = "",
  axis.title = "Credibility (news)",
  legend.title = "Framing",
  axis.labels = TRUE,
  colors = "gs",
  show.values = TRUE,
  value.offset = .3,
  value.size = 5,
  dot.size = 2,
  line.size = 1,
  ylim = c(1,4),
  ci.style = c('bar')
) + labs(x = NULL)


                 
credibility_partisanship_2  <- plot_model(
  mod2, 
  type = "eff", 
  terms = c("putin_support", "slant_gov_deb"), 
  title = "", axis.title = "Credibility (debunking)", 
  legend.title = "Framing", 
  axis.labels = T, 
  colors = "gs", 
  show.values = TRUE, 
  value.offset = .3, 
  value.size = 5, 
  dot.size = 2,
  line.size = 1, 
  ylim = c(1,4), 
  ci.style = c('bar')
  ) + labs(x = NULL)

set_theme(
  base = theme_minimal(),
  axis.tickslen = 0, # hides tick marks
  axis.title.size = 1,
  axis.textsize = 0.88,
  legend.size = .7,
  legend.title.size = .8,
  geom.label.size = 3.5,
  axis.angle.x = 0,
  axis.angle.y = 0,
  legend.item.backcol = "white",
  legend.item.bordercol = "white"
)

credibility_partisanship_1 <- credibility_partisanship_1 + ylim(1.5,3)  + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_text(size = 15),   
    axis.text.y  = element_text(size = 15),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

credibility_partisanship_2 <- credibility_partisanship_2 + ylim(1.5,3)  + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_text(size = 15),   
    axis.text.y  = element_text(size = 15),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

credibility_partisanship_graph <- ggarrange(                 
credibility_partisanship_1,
credibility_partisanship_2, 
          ncol = 1, nrow = 2,
          align = "v",
          heights = c(.3,.3),
           common.legend = TRUE, legend="right")

credibility_partisanship_graph


# Save as Figure 5 with publication-quality resolution (dpi = 600)

ggsave(
  "Figure_5.png",
  plot   = credibility_partisanship_graph,
  width  = 6000, height = 5000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)



```

```{r pressure, echo=FALSE}

# 15. EXPERIMENT -- CREDIBILITY: FIGURE 6 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX

# The average effect of disinformation discourse and effects of each debunking item separately on credibility

amce_debunk_cred <- amce(df,trustworthy_combined ~ debunk)
amce_debunk_prdw_cred <- amce(df_PRDW, trustworthy_combined ~ debunk)
amce_debunk_prde_cred <- amce(df_PRDE , trustworthy_combined ~ debunk)
amce_debunk_ardw_cred <- amce(df_ARDW, trustworthy_combined ~ debunk)
amce_debunk_arde_cred <- amce(df_ARDE, trustworthy_combined ~ debunk)


cred_average_ggplot <- ggplot(as.data.frame(amce_debunk_cred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_cred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_cred), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Average effect") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) + 
  geom_text(data = subset(as.data.frame(amce_debunk_cred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_text(size = 15),   
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

cred_prdw_ggplot <- ggplot(as.data.frame(amce_debunk_prdw_cred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_prdw_cred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_prdw_cred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(amce_debunk_prdw_cred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),   
    axis.ticks.x = element_blank(),
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

cred_ardw_ggplot <- ggplot(as.data.frame(amce_debunk_ardw_cred ), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_ardw_cred ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_ardw_cred ), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(amce_debunk_ardw_cred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),   
    axis.ticks.x = element_blank(),
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

cred_prde_ggplot <- ggplot(as.data.frame(amce_debunk_prde_cred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_prde_cred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_prde_cred), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(amce_debunk_prde_cred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),   
    axis.ticks.x = element_blank(),
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

cred_arde_ggplot <- ggplot(as.data.frame(amce_debunk_arde_cred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_arde_cred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_arde_cred), level != "news"),
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(amce_debunk_arde_cred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),   
    axis.ticks.x = element_blank(),
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

amce_sep_cred_graph_ggplot <- plot_grid(
  cred_prdw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  cred_prde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  cred_ardw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  cred_arde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  cred_average_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.8)  
) 

amce_sep_cred_graph_ggplot

# Save as Figure 6 with publication-quality resolution (dpi = 600)

ggsave(
  "Figure_6.png",
  plot   = amce_sep_cred_graph_ggplot,
  width  = 5000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

#TABLE A2

amce_debunk_cred
amce_debunk_prdw_cred
amce_debunk_prde_cred
amce_debunk_ardw_cred
amce_debunk_arde_cred

str(amce_debunk_cred)
str(amce_debunk_prdw_cred)
str(amce_debunk_prde_cred)
str(amce_debunk_ardw_cred)
str(amce_debunk_arde_cred)

```

```{r pressure, echo=FALSE}

# 16. MEDIA TRUST -- DESCRIPTIVE STATISTICS: TABLE 2 IN THE MAIN TEXT

# Media trust - means and standard deviations 

# News 

df_summary_offline <- df %>%
  summarise(mean_offline = mean(trad_num, na.rm = TRUE), SD_offline = sd(trad_num, na.rm = TRUE))

df_summary_offline_part <- df %>%
  group_by(putin_support2) %>%
  summarise(mean_offline = mean(trad_num, na.rm = TRUE), SD_offline = sd(trad_num, na.rm = TRUE))

df_offline_trust <- df_summary_offline_part %>%
    bind_rows(df_summary_offline %>% mutate(putin_support2 = "Average"))

# Debunking

df_summary_online <- df %>%
  summarise(mean_online = mean(new_num, na.rm = TRUE), SD_online = sd(new_num, na.rm = TRUE))

df_summary_online_part <- df %>%
  group_by(putin_support2) %>%
  summarise(mean_online = mean(new_num, na.rm = TRUE), SD_online = sd(new_num, na.rm = TRUE))

df_online_trust  <- df_summary_online_part %>%
    bind_rows(df_summary_online %>% mutate(putin_support2 = "Average"))

df_final_trust <- df_offline_trust %>%
  left_join(df_online_trust, by = "putin_support2")


# TABLE 2

df_final_trust
str(df_final_trust)


```

```{r pressure, echo=FALSE}

# 17. EXPERIMENT -- OFFLINE MEDIA TRUST: FIGURE 7 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX

# The average marginal component effects of disinformation discourse and separate effects of each debunking item on offline media trust (AMCE)

# Average

amce_debunk_trust_trad <- amce(df, trad_num ~ debunk)
trad_trust_average_ggplot <- ggplot(as.data.frame(amce_debunk_trust_trad), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_trust_trad), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_trust_trad), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Offline trust", y = "Average effect") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6))  +
    geom_text(data = subset(as.data.frame(amce_debunk_trust_trad), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_text(size = 15),  
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# War: Pro-regime debunking

prdw_trad_trust <- amce(df_PRDW, trad_num ~ debunk)
trad_trust_prdw_ggplot <- ggplot(as.data.frame(prdw_trad_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_trad_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_trad_trust), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(prdw_trad_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Pro-regime debunking

prde_trad_trust <- amce(df_PRDE , trad_num ~ debunk)
trad_trust_prde_ggplot <- ggplot(as.data.frame(prde_trad_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_trad_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_trad_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(prde_trad_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# War: Anti-regime debunking

ardw_trad_trust <- amce(df_ARDW, trad_num ~ debunk)
trad_trust_ardw_ggplot <- ggplot(as.data.frame(ardw_trad_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_trad_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_trad_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(ardw_trad_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Anti-regime debunking

arde_trad_trust <- amce(df_ARDE, trad_num ~ debunk)
trad_trust_arde_ggplot <- ggplot(as.data.frame(arde_trad_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_trad_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_trad_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),        
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(arde_trad_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Merging

amce_sep_trad_trust_graph_ggplot <- plot_grid(
  trad_trust_prdw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  trad_trust_prde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  trad_trust_ardw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  trad_trust_arde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  trad_trust_average_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.8)  
)

amce_sep_trad_trust_graph_ggplot

# TABLE A2

amce_debunk_trust_trad
prdw_trad_trust
prde_trad_trust
ardw_trad_trust
arde_trad_trust

str(amce_debunk_trust_trad)
str(prdw_trad_trust)
str(prde_trad_trust) 
str(ardw_trad_trust)
str(arde_trad_trust)


```

```{r pressure, echo=FALSE}

# 18. EXPERIMENT -- ONLINE MEDIA TRUST: FIGURE 7 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX

# The average marginal component effects of disinformation discourse and separate effects of each debunking item on online media trust (AMCE)

# Average

amce_debunk_trust_new <- amce(df, new_num ~ debunk)
new_trust_average_ggplot <- ggplot(as.data.frame(amce_debunk_trust_new), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_trust_new), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_trust_new), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Online trust", y = "Average effect") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),         
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(amce_debunk_trust_new), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_blank(), 
    axis.text.x  = element_text(size = 15),  
    element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# War: Pro-regime debunking

prdw_new_trust <- amce(df_PRDW, new_num ~ debunk)
new_trust_prdw_ggplot <- ggplot(as.data.frame(prdw_new_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_new_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_new_trust), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(prdw_new_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_blank(),  
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# War: Anti-regime debunking

ardw_new_trust <- amce(df_ARDW, new_num ~ debunk)
new_trust_ardw_ggplot <- ggplot(as.data.frame(ardw_new_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_new_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_new_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "War: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),       
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(ardw_new_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_blank(),
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Pro-regime debunking

prde_new_trust <- amce(df_PRDE, new_num ~ debunk)
new_trust_prde_ggplot <- ggplot(as.data.frame(prde_new_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_new_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_new_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Pro-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),       
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(prde_new_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_blank(),  
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Anti-regime debunking

arde_new_trust <- amce(df_ARDE, new_num ~ debunk)
new_trust_arde_ggplot <- ggplot(as.data.frame(arde_new_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_new_trust), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_new_trust), level != "news"),
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Credibility of a news story", y = "Econ: Anti-regime debunking") +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
           axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),       
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.6, 0.6)) +
    geom_text(data = subset(as.data.frame(arde_new_trust), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),
    axis.title.y = element_blank(),  
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),   
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Merging

amce_sep_new_trust_graph_ggplot <- plot_grid(
  new_trust_prdw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  new_trust_prde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  new_trust_ardw_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  new_trust_arde_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  new_trust_average_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.8)  
)

amce_sep_trust_graph_ggplot <- plot_grid(
  amce_sep_trad_trust_graph_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_sep_new_trust_graph_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 2,
  align = 'v',
  rel_heights = c(1, 1),
  rel_widths = c(1, 0.5)
)

amce_sep_trust_graph_ggplot

ggsave(
  "Figure_7.png",
  plot   = amce_sep_trust_graph_ggplot,
  width  = 5000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A2 

amce_debunk_trust_new
prdw_new_trust
ardw_new_trust
prde_new_trust
arde_new_trust

str(amce_debunk_trust_new)
str(prdw_new_trust)
str(ardw_new_trust)
str(prde_new_trust)
str(arde_new_trust)

```

```{r pressure, echo=FALSE}

# 19. RESPONSIBILITY ATTRIBUTION -- DESCRIPTIVE STATISTICS: TABLE A3 IN THE MAIN TEXT

# Resp attribution  - means and standard deviations 

# Average 

df_summary_resp <- df %>%
  summarise(mean_russia = mean(russia_blame, na.rm = TRUE), SD_russia = sd(russia_blame, na.rm = TRUE),
            mean_ukraine = mean(UA_blame, na.rm = TRUE), SD_ukraine = sd(UA_blame, na.rm = TRUE), 
            mean_west = mean(west_blame, na.rm = TRUE), SD_west = sd(west_blame, na.rm = TRUE),
            mean_blurred = mean(blurred_blame, na.rm = TRUE), SD_blurred = sd(blurred_blame, na.rm = TRUE))

df_summary_resp_part <- df %>%
  group_by(putin_support2) %>%
  summarise(mean_russia = mean(russia_blame, na.rm = TRUE), SD_russia = sd(russia_blame, na.rm = TRUE),
            mean_ukraine = mean(UA_blame, na.rm = TRUE), SD_ukraine = sd(UA_blame, na.rm = TRUE), 
            mean_west = mean(west_blame, na.rm = TRUE), SD_west = sd(west_blame, na.rm = TRUE),
            mean_blurred = mean(blurred_blame, na.rm = TRUE), SD_blurred = sd(blurred_blame, na.rm = TRUE))

df_resp_merged <- df_summary_resp_part %>%
    bind_rows(df_summary_resp %>% mutate(putin_support2 = "Average"))

#  TABLE A3

df_resp_merged
str(df_resp_merged)

```

```{r pressure, echo=FALSE}

# 20. EXPERIMENT -- RESPONSIBILITY ATTRIBUTION: FIGURE 8 IN THE MAIN TEXT AND TABLE A2 IN THE APPENDIX

# The average of disinforomation discourse and separate effects of each debunking items on attribution of responsibility to Russia, Ukraine, the West, or refusal to attribute responsibility (AMCE). 

# RUSSIA GGPLOT

# Average effect

amce_debunk_russia <- amce(df,russia_blame ~ debunk)
amce_debunk_russia_ggplot <- ggplot(as.data.frame(amce_debunk_russia), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_russia ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_russia ), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +
    labs(x = "Responsibility attribution: Russia", y = 'Average effect') +  
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5), 
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(amce_debunk_russia), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# War: Pro-regime debunking

prdw_russia <- amce(df_PRDW, russia_blame ~ debunk)
prdw_debunk_russia_ggplot <- ggplot(as.data.frame(prdw_russia), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_russia ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_russia ), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'War: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5), 
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5))  +
    geom_text(data = subset(as.data.frame(prdw_russia), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Econ: Pro-regime debunking

prde_russia <- amce(df_PRDE, russia_blame ~ debunk)
prde_debunk_russia_ggplot <- ggplot(as.data.frame(prde_russia), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_russia ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_russia ), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'Econ: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5), 
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5))  +
    geom_text(data = subset(as.data.frame(prde_russia), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# War: Anti-regime debunking

ardw_russia <- amce(df_ARDW, russia_blame ~ debunk)
ardw_debunk_russia_ggplot <- ggplot(as.data.frame(ardw_russia), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_russia ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_russia ), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'War: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),  
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5))  +
    geom_text(data = subset(as.data.frame(ardw_russia), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Econ: Anti-regime debunking

arde_russia <- amce(df_ARDE, russia_blame ~ debunk)
arde_debunk_russia_ggplot <- ggplot(as.data.frame(arde_russia), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_russia ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_russia ), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = ' Econ: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5), 
          legend.position = "none", 
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5))  +
    geom_text(data = subset(as.data.frame(arde_russia), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

amce_sep_russia_graph_ggplot <- plot_grid(
  amce_debunk_russia_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prdw_debunk_russia_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prde_debunk_russia_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ardw_debunk_russia_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  arde_debunk_russia_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 5,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.4)  
)

# UA GGPLOT

# Average effect

amce_debunk_ua <- amce(df, UA_blame ~ debunk)
amce_debunk_ua_ggplot <- ggplot(as.data.frame(amce_debunk_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_ua), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +
    labs(x = "Responsibility attribution: Russia") +  
    theme_bw() +                                                    
     theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(amce_debunk_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )

# War: Pro-regime debunking

prdw_ua <- amce(df_PRDW, UA_blame ~ debunk)
prdw_debunk_ua_ggplot <- ggplot(as.data.frame(prdw_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'War: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5))  +
    geom_text(data = subset(as.data.frame(prdw_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )


# Econ: Pro-regime debunking

prde_ua <- amce(df_PRDE, UA_blame ~ debunk)
prde_debunk_ua_ggplot <- ggplot(as.data.frame(prde_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'Econ: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(), 
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(prde_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )

# War: Anti-regime debunking

ardw_ua <- amce(df_ARDW, UA_blame ~ debunk)
ardw_debunk_ua_ggplot <- ggplot(as.data.frame(ardw_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'War: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(), 
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(ardw_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )


# Econ: Anti-regime debunking

arde_ua <- amce(df_ARDE, UA_blame ~ debunk)
arde_debunk_ua_ggplot <- ggplot(as.data.frame(arde_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = ' Econ: Anti-regime debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(), 
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(arde_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


amce_sep_ua_graph_ggplot <- plot_grid(
  amce_debunk_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prdw_debunk_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prde_debunk_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ardw_debunk_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  arde_debunk_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 5,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.4))

# WEST GGPLOT

# Average effect

amce_debunk_west <- amce(df,west_blame ~ debunk)
amce_debunk_west_ggplot <- ggplot(as.data.frame(amce_debunk_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_west), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +
    labs(x = "Responsibility attribution: The West", y = 'Average effect') +  
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5), 
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(amce_debunk_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )



# War: Pro-regime debunking

prdw_west <- amce(df_PRDW, west_blame ~ debunk)
prdw_debunk_west_ggplot <- ggplot(as.data.frame(prdw_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'War: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),  
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(prdw_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Pro-regime debunking

prde_west <- amce(df_PRDE, west_blame ~ debunk)
prde_debunk_west_ggplot <- ggplot(as.data.frame(prde_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Econ: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),  
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(prde_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# War: Anti-regime debunking

ardw_west <- amce(df_ARDW, west_blame ~ debunk)
ardw_debunk_west_ggplot <- ggplot(as.data.frame(ardw_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'War: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),  
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(ardw_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_blank(),  
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Econ: Anti-regime debunking

arde_west <- amce(df_ARDE, west_blame ~ debunk)
arde_debunk_west_ggplot <- ggplot(as.data.frame(arde_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = ' Econ: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.y = element_text(angle = 0, vjust = 0.5),  
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(arde_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_text(size = 15), 
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )



amce_sep_west_graph_ggplot <- plot_grid(
  amce_debunk_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prdw_debunk_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prde_debunk_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ardw_debunk_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  arde_debunk_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 5,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.9))

# BLURRED GGPLOT

# Average effect

amce_debunk_blurred <- amce(df, blurred_blame ~ debunk)
amce_debunk_blurred_ggplot <- ggplot(as.data.frame(amce_debunk_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(amce_debunk_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(amce_debunk_blurred), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +
    labs(x = "Responsibility attribution: Russia") +  
    theme_bw() +                                                    
     theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(),
          axis.ticks.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(amce_debunk_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )

# War: Pro-regime debunking

prdw_blurred <- amce(df_PRDW, blurred_blame ~ debunk)
prdw_debunk_blurred_ggplot <- ggplot(as.data.frame(prdw_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prdw_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prdw_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'War: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(), 
          axis.ticks.y = element_blank(), 
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(prdw_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )


# Econ: Pro-regime debunking

prde_blurred <- amce(df_PRDE, blurred_blame ~ debunk)
prde_debunk_blurred_ggplot <- ggplot(as.data.frame(prde_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(prde_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(prde_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Econ: Pro-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(), 
          axis.ticks.y = element_blank(),   
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(prde_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )


# War: Anti-regime debunking

ardw_blurred <- amce(df_ARDW, blurred_blame ~ debunk)
ardw_debunk_blurred_ggplot <- ggplot(as.data.frame(ardw_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(ardw_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(ardw_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'War: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.x = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.y = element_blank(), 
          axis.ticks.y = element_blank(),  
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(ardw_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_blank(),    
    axis.title.x = element_blank(),  
    axis.title.y = element_blank(),    
    axis.text.x  = element_blank(),  
    legend.title = element_blank(),  
    legend.text  = element_blank(),  
  )


# Econ: Anti-regime debunking

arde_blurred <- amce(df_ARDE, blurred_blame ~ debunk)
arde_debunk_blurred_ggplot <- ggplot(as.data.frame(arde_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(arde_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(arde_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = ' Econ: Anti-regime debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          axis.title.y = element_blank(), 
          axis.ticks.y = element_blank(),   
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.5, 0.5)) +
    geom_text(data = subset(as.data.frame(arde_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 30),   
    axis.title.x = element_text(size = 15), 
    axis.title.y = element_blank(),    
    axis.text.x  = element_text(size = 15), 
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Merging

amce_sep_blurred_graph_ggplot <- plot_grid(
  amce_debunk_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prdw_debunk_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  prde_debunk_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ardw_debunk_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  arde_debunk_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 5,
  align = 'v',
  rel_heights = c(1, 1, 1, 1, 1.9))

amce_merged_graph_ggplot <- plot_grid(
  amce_sep_russia_graph_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_sep_ua_graph_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_sep_west_graph_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_sep_blurred_graph_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 2,
  align = 'v',
  rel_heights = c(1, 1, 1, 1),
  rel_widths = c(1.7, 1, 1.7, 1))


amce_merged_graph_ggplot

# Save as Figure 8 with publication-quality resolution (dpi = 600)

ggsave(
  "Figure_8.png",
  plot   = amce_merged_graph_ggplot,
  width  = 7000, height = 4000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A2

str(amce_debunk_russia)
str(prdw_russia)
str(prde_russia) 
str(ardw_russia) 
str(arde_russia) 
str(amce_debunk_ua)
str(prdw_ua)
str(prde_ua)
str(ardw_ua)
str(arde_ua)
str(amce_debunk_west)
str(prdw_west)
str(prde_west)
str(ardw_west)
str(arde_west)
str(amce_debunk_blurred)
str(prdw_blurred)
str(prde_blurred)
str(ardw_blurred)
str(arde_blurred)

```

```{r pressure, echo=FALSE}

# 21. EXPERIMENT -- RESPONSIBILITY ATTRIBUTION BY PARTISANSHIP: FIGURE 9 IN THE MAIN TEXT AND TABLE A3 IN THE APPENDIX

# DISINFORMATION DISCOURSE AND REFUSAL TO ATTRIBUTE RESPONSIBILITY - DISAGGREGATE BY PARTISANSHIP

# Putin supporters 

df_pro_blurred <- amce(df_pro, blurred_blame ~ debunk)
df_pro_blurred_ggplot <- ggplot(as.data.frame(df_pro_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_pro_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_pro_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Putin supporters") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  +
    geom_text(data = subset(as.data.frame(df_pro_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Putin critics

df_anti_blurred <- amce(df_anti, blurred_blame ~ debunk)
df_anti_blurred_ggplot <- ggplot(as.data.frame(df_anti_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_anti_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_anti_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Putin critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))+
    geom_text(data = subset(as.data.frame(df_anti_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# Undecided

df_und_blurred <- amce(df_und, blurred_blame ~ debunk)
df_und_blurred_ggplot <- ggplot(as.data.frame(df_und_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_und_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_und_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_und_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Putin merge

amce_putin_sep_ggplot <- plot_grid(
  df_pro_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_anti_blurred_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_und_blurred_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# UR supporters

df_UR_blurred <- amce(df_UR, blurred_blame ~ debunk)
df_UR_blurred_ggplot <- ggplot(as.data.frame(df_UR_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_UR_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_UR_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("UR supporters") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_UR_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# UR critics

df_no_UR_blurred <- amce(df_no_UR, blurred_blame ~ debunk)
df_no_UR_blurred_ggplot <- ggplot(as.data.frame(df_no_UR_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_UR_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_UR_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("UR critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_no_UR_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Undecided

df_ns_UR_blurred <- amce(df_ns_UR, blurred_blame ~ debunk)
df_ns_UR_blurred_ggplot <- ggplot(as.data.frame(df_ns_UR_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_ns_UR_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_ns_UR_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_ns_UR_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# UR merge

amce_ur_sep_ggplot <- plot_grid(
  df_UR_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_ns_UR_blurred_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# Any parliamentary party

df_parties_blurred <- amce(df_party_pro, blurred_blame ~ debunk)
df_parties_blurred_ggplot <- ggplot(as.data.frame(df_parties_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_parties_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_parties_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Any registered party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_parties_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_text(size = 15),   
    axis.text.x  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# No parties

df_no_party_blurred <- amce(df_party_anti, blurred_blame ~ debunk)
df_no_party_blurred_ggplot <- ggplot(as.data.frame(df_no_party_blurred ), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_party_blurred ), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_party_blurred ), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("No party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_no_party_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Undecided

df_party_ns_blurred <- amce(df_party_ns, blurred_blame ~ debunk)
df_party_ns_blurred_ggplot <- ggplot(as.data.frame(df_party_ns_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_party_ns_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_party_ns_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_party_ns_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_blank(), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_blank(),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Parties merge

amce_parties_sep_ggplot <- plot_grid(
  df_parties_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_party_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_ns_blurred_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# TV

df_tv_blurred <- amce(df_tv, blurred_blame ~ debunk)
df_tv_blurred_ggplot <- ggplot(as.data.frame(df_tv_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_tv_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_tv_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_tv_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_text(size = 9), 
    axis.title.y = element_text(size = 15),  
    axis.text.x  = element_text(size = 15),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# No TV

df_no_tv_blurred <- amce(df_no_tv, blurred_blame ~ debunk)
df_no_tv_blurred_ggplot <- ggplot(as.data.frame(df_no_tv_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_tv_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_tv_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_no_tv_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_text(size = 9), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_text(size = 15),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )


# Undecided

df_tv_ns_blurred <- amce(df_tv_ns, blurred_blame ~ debunk)
df_tv_ns_blurred_ggplot <- ggplot(as.data.frame(df_tv_ns_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_tv_ns_blurred), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_tv_ns_blurred), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-0.7, 0.7)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +
    geom_text(data = subset(as.data.frame(df_tv_ns_blurred), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) + theme(
    plot.title   = element_text(size = 15),   
    axis.title.x = element_text(size = 9), 
    axis.title.y = element_blank(),   
    axis.text.x  = element_text(size = 15),  
    axis.text.y  = element_blank(),  
    legend.title = element_text(size = 17),   
    legend.text  = element_text(size = 15)  
  )

# TV merge

amce_tv_sep_ggplot <- plot_grid(
  df_tv_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_tv_ns_blurred_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

amce_part_sep_ggplot <- plot_grid(
  amce_putin_sep_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_ur_sep_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_parties_sep_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_tv_sep_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.6))

amce_part_sep_ggplot 

# Save as Figure 8 with publication-quality resolution (dpi = 600)

ggsave(
  "Figure_9.png",
  plot   = amce_part_sep_ggplot,
  width  = 5500, height =2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A3

str(df_pro_blurred)
str(df_anti_blurred)
str(df_und_blurred)
str(df_UR_blurred)
str(df_no_UR_blurred)
str(df_ns_UR_blurred)
str(df_parties_blurred)
str(df_no_party_blurred)
str(df_party_ns_blurred)
str(df_tv_blurred)
str(df_no_tv_blurred) 
str(df_tv_ns_blurred)


```

```{r pressure, echo=FALSE}

# 22. WAR VS ECONOMY -- CREDIBILITY: Z-VALUES for P.22-33 and TABLE A4 IN THE APPENDIX

# Calculating differences between war-focused and economy-focused debunking stories as well as each pair of debunking stories for credibility and refusal to attribute responsibility

# Credibility Difference

amce_c_war <- amce(df_war, trustworthy_combined  ~ debunk)
amce_c_ec <- amce(df_ec, trustworthy_combined  ~ debunk)
amce_c_PRDW <- amce(df_PRDW, trustworthy_combined  ~ debunk)
amce_c_PRDE <- amce(df_PRDE, trustworthy_combined  ~ debunk)
amce_c_ARDW <- amce(df_ARDW, trustworthy_combined  ~ debunk)
amce_c_ARDE <- amce(df_ARDE, trustworthy_combined  ~ debunk)


diff_results_av <- data.frame(
  comparison = "War vs. Economy (Average)",
  difference = amce_c_war$estimate[2] - amce_c_ec$estimate[2],
  se_difference = sqrt(amce_c_war$std.error[2]^2 + amce_c_ec$std.error[2]^2),
  z_score = (amce_c_war$estimate[2] - amce_c_ec$estimate[2]) / sqrt(amce_c_war$std.error[2]^2 + amce_c_ec$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_war$estimate[2] - amce_c_ec$estimate[2]) / sqrt(amce_c_war$std.error[2]^2 + amce_c_ec$std.error[2]^2))))
)

diff_results_prdw_prde <- data.frame(
  comparison = "W:PRD vs. E:PRD",
  difference = amce_c_war$estimate[2] - amce_c_ec$estimate[2],
  se_difference = sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_PRDE$std.error[2]^2),
  z_score = (amce_c_PRDW$estimate[2] - amce_c_PRDE$estimate[2]) / sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_PRDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_PRDW$estimate[2] - amce_c_PRDE$estimate[2]) / sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_PRDE$std.error[2]^2))))
)


diff_results_prdw_ardw <- data.frame(
  comparison = "W:PRD vs. W:ARD",
  difference = amce_c_PRDW$estimate[2] - amce_c_ARDW$estimate[2],
  se_difference = sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDW$std.error[2]^2),
  z_score = (amce_c_PRDW$estimate[2] - amce_c_ARDW$estimate[2]) / 
            sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDW$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_PRDW$estimate[2] - amce_c_ARDW$estimate[2]) / 
            sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDW$std.error[2]^2))))
)

diff_results_prdw_arde <- data.frame(
  comparison = "W:PRD vs. E:ARD",
  difference = amce_c_PRDW$estimate[2] - amce_c_ARDE$estimate[2],
  se_difference = sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  z_score = (amce_c_PRDW$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_PRDW$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_PRDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2))))
)

diff_results_ardw_prde <- data.frame(
  comparison = "W:ARD vs. E:PRD",
  difference = amce_c_PRDE$estimate[2] - amce_c_ARDW$estimate[2],
  se_difference = sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDW$std.error[2]^2),
  z_score = (amce_c_PRDE$estimate[2] - amce_c_ARDW$estimate[2]) / 
            sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDW$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_PRDE$estimate[2] - amce_c_ARDW$estimate[2]) / 
            sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDW$std.error[2]^2))))
)

diff_results_ardw_arde <- data.frame(
  comparison = "W:ARD vs. E:ARD",
  difference = amce_c_ARDW$estimate[2] - amce_c_ARDE$estimate[2],
  se_difference = sqrt(amce_c_ARDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  z_score = (amce_c_ARDW$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_ARDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_ARDW$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_ARDW$std.error[2]^2 + amce_c_ARDE$std.error[2]^2))))
)

diff_results_prde_arde <- data.frame(
  comparison = "E:PRD vs. E:ARD",
  difference = amce_c_PRDE$estimate[2] - amce_c_ARDE$estimate[2],
  se_difference = sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  z_score = (amce_c_PRDE$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_c_PRDE$estimate[2] - amce_c_ARDE$estimate[2]) / 
            sqrt(amce_c_PRDE$std.error[2]^2 + amce_c_ARDE$std.error[2]^2))))
)




final_diff_results <- rbind(diff_results_av, 
                            diff_results_prdw_ardw,
                             diff_results_prdw_prde,
                             diff_results_prdw_arde,
                             diff_results_ardw_prde,
                             diff_results_ardw_arde,
                             diff_results_prde_arde)


# TABLE A4


final_diff_results 
str(final_diff_results)
```

```{r pressure, echo=FALSE}

# 23. WAR VS ECONOMY -- RESPONSIBILITY Z-VALUES for P.22-33 and TABLE A4 IN THE APPENDIX

# Calculating differences between war-focused and economy-focused debunking stories as well as each pair of debunking stories for credibility and refusal to attribute responsibility

# Blurred Blame Difference

amce_b_war <- amce(df_war, blurred_blame  ~ debunk)
amce_b_ec <- amce(df_ec, blurred_blame  ~ debunk)
amce_b_PRDW <- amce(df_PRDW, blurred_blame  ~ debunk)
amce_b_PRDE <- amce(df_PRDE, blurred_blame ~ debunk)
amce_b_ARDW <- amce(df_ARDW, blurred_blame ~ debunk)
amce_b_ARDE <- amce(df_ARDE, blurred_blame ~ debunk)

diff_results_b_av <- data.frame(
  comparison = "War vs. Economy (Average)",
  difference = amce_b_war$estimate[2] - amce_b_ec$estimate[2],
  se_difference = sqrt(amce_b_war$std.error[2]^2 + amce_b_ec$std.error[2]^2),
  z_score = (amce_b_war$estimate[2] - amce_b_ec$estimate[2]) / 
            sqrt(amce_b_war$std.error[2]^2 + amce_b_ec$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_war$estimate[2] - amce_b_ec$estimate[2]) / 
            sqrt(amce_b_war$std.error[2]^2 + amce_b_ec$std.error[2]^2))))
)


diff_results_b_prdw_prde <- data.frame(
  comparison = "W:PRD vs. E:PRD",
  difference = amce_b_PRDW$estimate[2] - amce_b_PRDE$estimate[2],
  se_difference = sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_PRDE$std.error[2]^2),
  z_score = (amce_b_PRDW$estimate[2] - amce_b_PRDE$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_PRDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_PRDW$estimate[2] - amce_b_PRDE$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_PRDE$std.error[2]^2))))
)


diff_results_b_prdw_ardw <- data.frame(
  comparison = "W:PRD vs. W:ARD",
  difference = amce_b_PRDW$estimate[2] - amce_b_ARDW$estimate[2],
  se_difference = sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDW$std.error[2]^2),
  z_score = (amce_b_PRDW$estimate[2] - amce_b_ARDW$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDW$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_PRDW$estimate[2] - amce_b_ARDW$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDW$std.error[2]^2))))
)


diff_results_b_prdw_arde <- data.frame(
  comparison = "W:PRD vs. E:ARD",
  difference = amce_b_PRDW$estimate[2] - amce_b_ARDE$estimate[2],
  se_difference = sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  z_score = (amce_b_PRDW$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_PRDW$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_PRDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2))))
)


diff_results_b_prde_ardw <- data.frame(
  comparison = "W:ARD vs. E:PRD",
  difference = amce_b_PRDE$estimate[2] - amce_b_ARDW$estimate[2],
  se_difference = sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDW$std.error[2]^2),
  z_score = (amce_b_PRDE$estimate[2] - amce_b_ARDW$estimate[2]) / 
            sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDW$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_PRDE$estimate[2] - amce_b_ARDW$estimate[2]) / 
            sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDW$std.error[2]^2))))
)

diff_results_b_prde_arde <- data.frame(
  comparison = "E:PRD vs. E:ARD",
  difference = amce_b_PRDE$estimate[2] - amce_b_ARDE$estimate[2],
  se_difference = sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  z_score = (amce_b_PRDE$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_PRDE$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_PRDE$std.error[2]^2 + amce_b_ARDE$std.error[2]^2))))
)

diff_results_b_ardw_arde <- data.frame(
  comparison = "W:ARD vs. E:ARD",
  difference = amce_b_ARDW$estimate[2] - amce_b_ARDE$estimate[2],
  se_difference = sqrt(amce_b_ARDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  z_score = (amce_b_ARDW$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_ARDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2),
  p_value = 2 * (1 - pnorm(abs((amce_b_ARDW$estimate[2] - amce_b_ARDE$estimate[2]) / 
            sqrt(amce_b_ARDW$std.error[2]^2 + amce_b_ARDE$std.error[2]^2))))
)

final_diff_results_b <- rbind(diff_results_b_av, 
                               diff_results_b_prdw_prde,
                               diff_results_b_prdw_ardw,
                               diff_results_b_prdw_arde,
                               diff_results_b_prde_ardw,
                               diff_results_b_prde_arde,
                               diff_results_b_ardw_arde)

final_diff_results_b 

str(final_diff_results_b )

```

```{r pressure, echo=FALSE}

# A1. PROPA EXPERIMENT -- MEDIA TRUST: FIGURE A1 and TABLE A5 IN THE APPENDIX

# Improting the PROPA dataset. 

df2 <- read.csv("PROPA_portion.csv") 

# PROPA recoding treatment groups and offline and online media trust outcome variables

df2 <- df2 %>%
    mutate (group = case_when(
        Q13b != '' ~ "disinfo",
        Q13c != '' ~ "disinfo expert",
        Q13d != '' ~ "disinfo anti-regime",
        Q13e != '' ~ "disinfo pro-regime",
        Q13f != '' ~ "disinfo expert anti-regime",
        Q13g != '' ~ "disinfo expert pro-regime",
        TRUE ~ "control"))

df2$group <- factor(df2$group, levels = c(
      'control',
      'disinfo',
      'disinfo expert',
      'disinfo pro-regime',
      'disinfo anti-regime',
      'disinfo expert pro-regime',
      'disinfo expert anti-regime'))

df2$group <- as.factor(df2$group)

df2 <- df2 %>%
  filter (Q14 != 'NA') %>%
  mutate(offline_trust = case_when(
    Q14 == '1'  ~ 2,
    Q14 == '2'  ~ 1,
    Q14 == '3'  ~ -1,
    Q14 == '4'  ~ -2,
    Q14 == '99' ~ NA))

df2 <- df2 %>%
  filter (Q15 != 'NA') %>%
  mutate(online_trust = case_when(
    Q15 == '1'  ~ 2,
    Q15 == '2'  ~ 1,
    Q15 == '3'  ~ -1,
    Q15 == '4'  ~ -2,
    Q15 == '5' ~ NA))


# MEDIA TRUST 

# Online Trust

int_trust <- amce(df2, online_trust ~ group)
int_trust_ggplot <- ggplot(as.data.frame(int_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = as.data.frame(int_trust), 
               aes(color = ifelse(level == "control", NA, "black"),  
                   size = ifelse(level == "control", 0, 2)),  
               na.rm = TRUE) +
    scale_color_identity() +  
    scale_size_identity() +  
    geom_errorbarh(data = subset(as.data.frame(int_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Trust in online sources") +               
    theme_bw() +                                                    
    theme(
          axis.title.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-0.4, 0.4)) +
    geom_text(data = subset(as.data.frame(int_trust), level != "control"),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) 

# Offline Trust

tv_trust <- amce(df2, offline_trust ~ group)
tv_trust_ggplot <- ggplot(as.data.frame(tv_trust), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = as.data.frame(tv_trust), 
               aes(color = ifelse(level == "control", NA, "black"), 
                   size = ifelse(level == "control", 0, 2)),
               na.rm = TRUE) +
    scale_color_identity() +
    scale_size_identity() +  
    geom_errorbarh(data = subset(as.data.frame(tv_trust), level != "news"),  
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Trust in television") +               
    theme_bw() +                                                    
    theme(
          axis.title.y = element_blank(),
          axis.text.y = element_blank(),
          axis.ticks.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-0.4, 0.4)) +
    geom_text(data = subset(as.data.frame(tv_trust), level != "control"),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) 

# Merging

tv_int_trust_graph_ggplot <- plot_grid(
  int_trust_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  tv_trust_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 2,
  align = 'h',
  rel_heights = c(1, 1),
  rel_widths = c(1.7, 1)  
)


# FIGURE A1 

tv_int_trust_graph_ggplot

ggsave(
  "Figure_A1.png",
  plot   = tv_int_trust_graph_ggplot,
  width  = 5000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A5

str(int_trust)
str(tv_trust)

```

```{r pressure, echo=FALSE}

# A2. BACKFIRE EFFECT: FIGURE A2 and TABLE A6 IN THE APPENDIX

# BACKFIRE - WAR-FOCUSED ANTI-REGIME DEBUNKING ITEM AND ATTRIBUTION OF RESPONSIBILITY TO THE WEST - DISAGGREGATE BY PARTISANSHIP

# Putin supporters 

df_pro_west <- amce(df_ARDW_pro, west_blame ~ debunk)
df_pro_west_ggplot <- ggplot(as.data.frame(df_pro_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_pro_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_pro_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Putin supporters") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_pro_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

# Putin critics

df_anti_west <- amce(df_ARDW_anti, west_blame ~ debunk)
df_anti_west_ggplot <- ggplot(as.data.frame(df_anti_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_anti_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_anti_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Putin critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Putin critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_anti_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)


# Undecided

df_und_west <- amce(df_ARDW_und, west_blame ~ debunk)
df_und_west_ggplot <- ggplot(as.data.frame(df_und_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_und_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_und_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  +                                
    geom_text(data = subset(as.data.frame(df_und_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) 

# Putin merge

amce_putin_west_ggplot <- plot_grid(
  df_pro_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_anti_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_und_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# UR supporters

df_UR_west <- amce(df_ARDW_UR, west_blame ~ debunk)
df_UR_west_ggplot <- ggplot(as.data.frame(df_UR_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_UR_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_UR_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("UR supporters") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("UR supporters") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_UR_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) 

# UR critics

df_no_UR_west <- amce(df_ARDW_no_UR, west_blame ~ debunk)
df_no_UR_west_ggplot <- ggplot(as.data.frame(df_no_UR_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_UR_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_UR_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("UR critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("UR critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_no_UR_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE) 

# Undecided

df_und_ns_UR_west <- amce(df_ARDW_ns_UR, west_blame ~ debunk)
df_und_ns_UR_west_ggplot <- ggplot(as.data.frame(df_und_ns_UR_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_und_ns_UR_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_und_ns_UR_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_und_ns_UR_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# UR merge

amce_ur_west_ggplot <- plot_grid(
  df_UR_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_und_ns_UR_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# Any parliamentary party

df_parties_west <- amce(df_ARDW_party_pro, west_blame ~ debunk)
df_parties_west_ggplot <- ggplot(as.data.frame(df_parties_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_parties_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_parties_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Any registered party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Any registered party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_parties_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# No parties

df_no_party_west <- amce(df_ARDW_party_anti, west_blame ~ debunk)
df_no_party_west_ggplot <- ggplot(as.data.frame(df_no_party_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_party_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_party_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("No party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_no_party_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# Undecided

df_party_ns_west <- amce(df_ARDW_party_ns, west_blame ~ debunk)
df_party_ns_west_ggplot <- ggplot(as.data.frame(df_party_ns_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_party_ns_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_party_ns_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_party_ns_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# Parties merge

amce_parties_west_ggplot <- plot_grid(
  df_parties_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_party_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_ns_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

# TV

df_tv_west <- amce(df_ARDW_tv, west_blame ~ debunk)
df_tv_west_ggplot <- ggplot(as.data.frame(df_tv_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_tv_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_tv_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_tv_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# No TV

df_no_tv_west <- amce(df_ARDW_no_tv, west_blame ~ debunk)
df_no_tv_west_ggplot <- ggplot(as.data.frame(df_no_tv_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_tv_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_tv_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_no_tv_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)  

# Undecided

df_tv_ns_west <- amce(df_ARDW_tv_ns, west_blame ~ debunk)
df_tv_ns_west_ggplot <- ggplot(as.data.frame(df_tv_ns_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_tv_ns_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_tv_ns_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility: The West", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
          legend.position = "none", 
         axis.title.y = element_blank(), 
         axis.ticks.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("Undecided") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +                                
    geom_text(data = subset(as.data.frame(df_tv_ns_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)   


# TV merge

amce_tv_west_ggplot <- plot_grid(
  df_tv_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_tv_ns_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 3,
  align = 'v',
  rel_heights = c(1, 1, 1))

amce_part_sep_west_ggplot <- plot_grid(
  amce_putin_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_ur_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_parties_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  amce_tv_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.5))


# FIGURE A2 

amce_part_sep_west_ggplot 

ggsave(
  "Figure_A2.png",
  plot   = amce_part_sep_west_ggplot ,
  width  = 5000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A6

str(df_pro_west)
str(df_anti_west)
str(df_und_west)
str(df_UR_west)
str(df_no_UR_west)
str(df_und_ns_UR_west)
str(df_parties_west)
str(df_no_party_west) 
str(df_party_ns_west)
str(df_tv_west)
str(df_no_tv_west) 
str(df_tv_ns_west)

```

```{r pressure, echo=FALSE}

# A3. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK 3 (BACKFIRING): FIGURE A3 and TABLE A7 IN THE APPENDIX

# Russia

df_anti_ru <- amce(df_ARDW_anti, russia_blame ~ debunk)
df_anti_ru_ggplot <- ggplot(as.data.frame(df_anti_ru), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_anti_ru), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_anti_ru), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2))  + ggplot2::ggtitle("Putin critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_anti_ru), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)


df_no_UR_ru <- amce(df_ARDW_no_UR, russia_blame ~ debunk)
df_no_UR_ru_ggplot <- ggplot(as.data.frame(df_no_UR_ru), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_UR_ru), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_UR_ru), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("UR critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_UR_ru), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_party_anti_ru <- amce(df_ARDW_party_anti, russia_blame ~ debunk)
df_party_anti_ggplot <- ggplot(as.data.frame(df_party_anti_ru), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_party_anti_ru), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_party_anti_ru), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),
         axis.text.x = element_blank(),
         axis.ticks.x = element_blank(),
         axis.title.x = element_blank(),
          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_party_anti_ru ), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_tv_ru <- amce(df_ARDW_no_tv, russia_blame ~ debunk)
df_no_tv_ru_ggplot <- ggplot(as.data.frame(df_no_tv_ru), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_tv_ru), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_tv_ru), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Russia", y = 'Debunking') +               
    theme_bw() +                                                    
   theme(axis.text.y = element_blank(),

          legend.position = "none", 
         axis.title.y = element_text(angle = 0, vjust = 0.5), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_tv_ru), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

# Ukraine 

df_anti_ua <- amce(df_ARDW_anti, UA_blame ~ debunk)
df_anti_ua_ggplot <- ggplot(as.data.frame(df_anti_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_anti_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_anti_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(),
          legend.position = "none", 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_anti_ua ), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_UR_ua <- amce(df_ARDW_no_UR, UA_blame ~ debunk)
df_no_UR_ua_ggplot <- ggplot(as.data.frame(df_no_UR_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_UR_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_UR_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_UR_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_party_anti_ua <- amce(df_ARDW_party_anti, UA_blame ~ debunk)
df_party_anti_ua_ggplot <- ggplot(as.data.frame(df_party_anti_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_party_anti_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_party_anti_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(),  
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_party_anti_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_tv_ua <- amce(df_ARDW_no_tv, UA_blame ~ debunk)
df_no_tv_ua_ggplot <- ggplot(as.data.frame(df_no_tv_ua), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_tv_ua), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_tv_ua), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Ukraine", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(),  
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_tv_ua), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

# West 

df_anti_west <- amce(df_ARDW_anti, west_blame ~ debunk)
df_anti_west_ggplot <- ggplot(as.data.frame(df_anti_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_anti_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_anti_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(),  
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_anti_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_UR_west <- amce(df_ARDW_no_UR, west_blame ~ debunk)
df_no_UR_west_ggplot <- ggplot(as.data.frame(df_no_UR_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_UR_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_UR_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_UR_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_party_anti_west <- amce(df_ARDW_party_anti, west_blame ~ debunk)
df_party_anti_west_ggplot <- ggplot(as.data.frame(df_party_anti_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_party_anti_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_party_anti_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          axis.text.x = element_blank(),
          axis.ticks.x = element_blank(),
          axis.title.x = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_party_anti_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_tv_west <- amce(df_ARDW_no_tv, west_blame ~ debunk)
df_no_tv_west_ggplot <- ggplot(as.data.frame(df_no_tv_west), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(data = subset(as.data.frame(df_no_tv_west), level != "news"),  
               size = 2, color = "black") +  
    geom_errorbarh(data = subset(as.data.frame(df_no_tv_west), level != "news"), 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: The West", y = 'Debunking') +               
    theme_bw() +                                                    
    theme(axis.text.y = element_blank(),
          legend.position = "none", 
          axis.ticks.y = element_blank(),
          axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank()) +                                
    coord_cartesian(xlim = c(-2, 2)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_tv_west), level != "news" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

amce_ardd_ru_ggplot <- plot_grid(
  df_anti_ru_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_ru_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_anti_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_ru_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.4))

amce_ardd_ua_ggplot <- plot_grid(
  df_anti_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_anti_ua_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_ua_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.4))

amce_ardd_west_ggplot <- plot_grid(
  df_anti_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_anti_west_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_west_ggplot  + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.4))

amce_ardd_resp <- plot_grid(
      amce_ardd_ru_ggplot,
      amce_ardd_ua_ggplot,
      amce_ardd_west_ggplot,
      ncol = 3,
      rel_widths = c(1.3,1,1)
)


# FIGURE A3

amce_ardd_resp 

ggsave(
  "Figure_A3.png",
  plot   = amce_ardd_resp ,
  width  = 5000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)


# TABLE A7 

str(df_anti_ru)
str(df_no_UR_ru) 
str(df_party_anti_ru)
str(df_no_tv_ru)
str(df_anti_ua)
str(df_no_UR_ua)
str(df_party_anti_ua)
str(df_no_tv_ua)
str(df_anti_west)
str(df_no_UR_west)
str(df_party_anti_west) 
str(df_no_tv_west)

```

```{r pressure, echo=FALSE}

# A4. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK 1 (RESPONSIBILITY): FIGURE A4 and TABLE A8 IN THE APPENDIX

# Creating graphs for the effect of anti-regime disinformation discourse on refusal to attribute responsibility among regime critics

df_anti_ardd_blurred <- amce(df_anti, blurred_blame ~ slant_gov_deb2)
df_anti_ardd_blurred_ggplot <- ggplot(as.data.frame(df_anti_ardd_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh( 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
          axis.title.y = element_blank(), 
          axis.title.x = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("Putin critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + 
    geom_text(data = subset(as.data.frame(df_anti_ardd_blurred), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)


df_no_UR_ardd_blurred <- amce(df_no_UR, blurred_blame ~ slant_gov_deb2)
df_no_UR_ardd_blurred_ggplot <- ggplot(as.data.frame(df_no_UR_ardd_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh(
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
          axis.title.y = element_blank(),
          axis.title.x = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("UR critics") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_UR_ardd_blurred), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_party_anti_ardd_blurred <- amce(df_party_anti, blurred_blame ~ slant_gov_deb2)
df_party_anti_ardd_blurred_ggplot <- ggplot(as.data.frame(df_party_anti_ardd_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh( 
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
          axis.title.y = element_blank(), 
          axis.title.x = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("No party") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_party_anti_ardd_blurred ), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_no_tv_ardd_blurred <- amce(df_no_tv, blurred_blame ~ slant_gov_deb2)
df_no_tv_ardd_blurred_ggplot <- ggplot(as.data.frame(df_no_tv_ardd_blurred), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh(
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Responsibility attribution: Blurred", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
           axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("No trust in TV") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))  + 
    geom_text(data = subset(as.data.frame(df_no_tv_ardd_blurred), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)


amce_ardd_ref_ggplot <- plot_grid(
  df_anti_ardd_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_UR_ardd_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_party_anti_ardd_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  df_no_tv_ardd_blurred_ggplot + theme(plot.margin = margin(0.1, 0.1, 0.1, 0.1)),
  ncol = 1,
  nrow = 4,
  align = 'v',
  rel_heights = c(1, 1, 1, 1.2))

# FIGURE A4 

amce_ardd_ref_ggplot

ggsave(
  "Figure_A4.png",
  plot   = amce_ardd_ref_ggplot,
  width  = 3000, height = 3000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)

# TABLE A8

str(df_anti_ardd_blurred)
str(df_no_UR_ardd_blurred) 
str(df_party_anti_ardd_blurred)
str(df_no_tv_ardd_blurred)

```

```{r pressure, echo=FALSE}

# A5. ROBUSTNESS -- SOCIAL DESIRABILITY CHECK 2 (PARTY SUPPORT): FIGURE A5 and TABLE A9 IN THE APPENDIX

# Creating graphs for the effect of anti-regime disinformation discourse on support for Putin among regime critics

df$putin_support3 <- recode(df$putin_support, 'Supporters' = 1, 
                                              'Critics' = -1,
                                              'Undecided' = 0)

df$UR_support2 <- recode(df$UR_support, 'Yes' = 1, 
                                              'No' = -1,
                                              'Not sure' = 0)

df_ardd_putin <- amce(df, putin_support3 ~ slant_gov_deb2)
df_ardd_putin_ggplot <- ggplot(as.data.frame(df_ardd_putin), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh(
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Support for Putin", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
           axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + 
    geom_text(data = subset(as.data.frame(df_ardd_putin), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)

df_ardd_ur <- amce(df, UR_support2 ~ slant_gov_deb2)
df_ardd_ur_ggplot <- ggplot(as.data.frame(df_ardd_ur), aes(x = estimate, y = level)) +
    geom_vline(xintercept = 0, linetype = "solid", color = "black", size = 0.2) +  
    geom_point(  
               size = 2, color = "black") +  
    geom_errorbarh(
                   aes(xmin = lower, xmax = upper), height = 0.2, color = "black", size = 0.5) +  
    labs(x = "Support for United Russia", y = 'Framing') +               
    theme_bw() +                                                    
   theme(
          legend.position = "none", 
           axis.title.y = element_blank(), 
          panel.grid.major = element_blank(),     
          panel.grid.minor = element_blank(),      
          ) +                                
    coord_cartesian(xlim = c(-1, 1)) + ggplot2::ggtitle("") + ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) + 
    geom_text(data = subset(as.data.frame(df_ardd_putin), level != "pro-regime" & !is.na(estimate)),
              aes(label = sprintf("italic(Δ) == %.2f * ',' ~ italic(α) == %.3f", estimate, p)),
              hjust = .5, vjust = -.7, size = 3, color = "black", parse = TRUE)


# FIGURE A5

df_ardd_ur_ggplot 

ggsave(
  "Figure_A5.png",
  plot   = df_ardd_ur_ggplot,
  width  = 3000, height = 1000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)


# TABLE A9 

str(df_ardd_putin)
str(df_ardd_ur)
```

```{r pressure, echo=FALSE}

# A6. ROBUSTNESS -- HETEROGENEOUS EFFECTS OF DEBUNKING ON CREDIBILITY: TABLE A10 IN THE APPENDIX

# Average

het_trustworthy_pro <- amce(df_pro,trustworthy_combined ~ debunk)
het_trustworthy_anti <- amce(df_anti,trustworthy_combined ~ debunk)
het_trustworthy_und <- amce(df_und,trustworthy_combined ~ debunk)

het_trustworthy_UR <- amce(df_UR,trustworthy_combined ~ debunk)
het_trustworthy_no_UR <- amce(df_no_UR,trustworthy_combined ~ debunk)
het_trustworthy_ns_UR <- amce(df_ns_UR,trustworthy_combined ~ debunk)

het_trustworthy_party_pro <- amce(df_party_pro,trustworthy_combined ~ debunk)
het_trustworthy_party_anti <- amce(df_party_anti,trustworthy_combined ~ debunk)
het_trustworthy_party_ns <- amce(df_party_ns,trustworthy_combined ~ debunk)

het_trustworthy_tv <- amce(df_tv,trustworthy_combined ~ debunk)
het_trustworthy_no_tv <- amce(df_no_tv,trustworthy_combined ~ debunk)
het_trustworthy_tv_ns <- amce(df_tv_ns,trustworthy_combined ~ debunk)

het_models <- list(het_trustworthy_pro, het_trustworthy_anti, het_trustworthy_und, het_trustworthy_UR, het_trustworthy_no_UR, het_trustworthy_ns_UR,  het_trustworthy_party_pro, het_trustworthy_party_anti, het_trustworthy_party_ns, het_trustworthy_tv, het_trustworthy_no_tv, het_trustworthy_tv_ns)

het_models  <- lapply(het_models, function(x) x[2, , drop = FALSE])

names(het_models) <- c("Putin Supporters", "Putin Critics", "Undecided", "UR Supporters", "UR Critics", "UR Undecided",  "Support a Party", "No Party", " Undecided", "Trust in TV", "No Trust", "Undecided" )


# TABLE A10
str(het_models)


```

```{r pressure, echo=FALSE}

# B1. BALANCE CHECK: TABLE B2 IN THE APPENDIX 

# Age 

mean_age <- df %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP) %>%
  summarise(mean_age = mean(age, na.rm = TRUE)) %>%
  arrange(as.numeric(GROUP))

chi_age <- chisq.test(table(df$GROUP, df$age))

# Gender

gender <- df %>%
  filter(gender == 0) %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP) %>%
  summarise(female = n() / nrow(df) * 1000) %>%
  arrange(as.numeric(GROUP))

chi_gender <- chisq.test(table(df$GROUP, df$gender))

# Education 

edu <- df %>%
  filter(edu == 6) %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP) %>%
  summarise(higher_ed = n() / nrow(df) * 1000) %>%
  arrange(as.numeric(GROUP))

chi_edu <- chisq.test(table(df$GROUP, df$edu))

# City

city <- df %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP, settlement_type) %>%
  summarise(count = n()) %>%
  group_by(GROUP) %>%
  mutate(city = 100 * (count / sum(count))) %>%
  filter(settlement_type == "City") %>%
  select(GROUP, city) %>%
  arrange(as.numeric(GROUP))

chi_city <- chisq.test(table(df$GROUP, df$settlement_type))

# Political interest

interest <- df %>%
  filter(interested_politics == 'somewhat interested') %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP, interested_politics) %>%
  summarise(interested_in_politics = n() / nrow(df) * 1000) %>%
  select(GROUP, interested_in_politics) %>%
  arrange(as.numeric(GROUP))

chi_interest <- chisq.test(table(df$GROUP, df$interested_politics))

# Support for Putin

support <- df %>%
  filter(putin_support == 'Supporters') %>%
  filter(GROUP %in% c(0:4, 7:10)) %>%
  group_by(GROUP, putin_support) %>%
  summarise(Support_Putin = n() / nrow(df) * 1000) %>%
  select(GROUP, Support_Putin) %>%
  arrange(as.numeric(GROUP))

chi_putin <- chisq.test(table(df$GROUP, df$putin_support))

# Combine all in one table

balance_check <- mean_age %>%
  left_join(gender, by = "GROUP") %>%
  left_join(edu, by = "GROUP") %>%
  left_join(city, by = "GROUP") %>%
  left_join(interest, by = "GROUP") %>%
  left_join(support, by = "GROUP")

chi_results <- tibble(
  GROUP = "Chi-squared",
  mean_age = chi_age$statistic,
  female = chi_gender$statistic,
  higher_ed = chi_edu$statistic,
  city = chi_city$statistic,
  interested_in_politics = chi_interest$statistic,
  Support_Putin = chi_putin$statistic
)

p_values <- tibble(
  GROUP = "p-value",
  mean_age = chi_age$p.value,
  female = chi_gender$p.value,
  higher_ed = chi_edu$p.value,
  city = chi_city$p.value,
  interested_in_politics = chi_interest$p.value,
  Support_Putin = chi_putin$p.value
)

balance_check <- balance_check %>%
  bind_rows(chi_results) %>%
  bind_rows(p_values)

# TABLE B2

balance_check
str(balance_check)


```

```{r pressure, echo=FALSE}

# B2. PROCESSING TASK: TABLE B3 IN THE APPENDIX 

# Calculating the percentage of correct answers to processing check questions. For war-related groups, the correct answer is 'Запорожская область'. For economy-related groups, the correct answer is 'Уровень инфляции'.

# War-related groups

# Create the war data frame
war <- df %>%
  group_by(GROUP, check1) %>%
  filter(check1 != 'NA') %>%
  select(check1) %>%
  summarise(n = n()) %>%
  mutate(correct = n / sum(n) * 100) %>%
  filter(check1 == 'Запорожская область') %>%
  select(GROUP, correct) %>%
  arrange(as.numeric(GROUP))

# Create the economy data frame

economy <- df %>%
  group_by(GROUP, check2) %>%
  filter(check2 != 'NA') %>%
  select(check2) %>%
  summarise(n = n()) %>%
  mutate(correct = n / sum(n) * 100) %>%
  filter(check2 == 'Уровень инфляции') %>%
  select(GROUP, correct) %>%
  arrange(as.numeric(GROUP))


processing_task <- war %>%
  bind_rows(economy)
  

# TABLE B3 

processing_task
str(processing_task)

```

```{r pressure, echo=FALSE}

# B3. POWER ANALYSIS: FIGURE B9 IN THE APPENDIX

u <- 3  
f2 <- 0.05  
G <- 9

pwr_result <- pwr.f2.test(u = u, v = NULL, f2 = f2, sig.level = 0.05, power = 0.9)

# The required sample size (n) per group and the total sample size

n_per_group <- ceiling(pwr_result$v + u + 1)
total_sample_size <- n_per_group * G

print(c(n_per_group, total_sample_size))

sample_sizes <- seq(50, 500, by = 10)  # Range of sample sizes per group
power_values <- sapply(sample_sizes, function(n) {
  pwr_result <- pwr.f2.test(u = u, v = n - u - 1, f2 = f2, sig.level = 0.001)
  return(pwr_result$power)
})

power_df <- data.frame(Sample_Size = sample_sizes, Power = power_values)

graph_power <- ggplot(power_df, aes(x = Sample_Size, y = Power)) +
  geom_line(color = "black", size = 2) + 
  geom_hline(yintercept = 0.9, linetype = "dashed", color = "black") +
  geom_text(x = n_per_group, y = 0.85, label = paste("n =", n_per_group), color = "black", hjust = -0.2) +
  labs(x = "Sample Size per Group", y = "Power") +
  theme_bw() +
  theme(legend.position = "none")


# FIGURE B9

graph_power 

ggsave(
  "Figure_B9.png",
  plot   = graph_power,
  width  = 2000, height = 2000, units = "px", dpi = 600,
  device = "png",
  bg     = "white"
)


```

```{r pressure, echo=FALSE}

# C1. SOCIO-DEMOGRAPHIC CHARACTERISTICS: TABLE C1 IN THE APPENDIX 

age_soc_dem <- df %>%
  summarise(mean_age = mean(age, na.rm = TRUE))

age_soc_dem_result <- tibble(
  category = "mean age",
  value = age_soc_dem$mean_age,
)

# Gender

gender_results <- df %>%
  filter(gender == 0 | gender == 1) %>%
  mutate(gender_label = ifelse(gender == 0, "female", "male")) %>%
  group_by(gender_label) %>%
  summarise(sample = n() / nrow(df) * 100) %>%
  select (gender_label, sample)

# Education

df <- df %>%
  mutate(edu_grouped = case_when(
    edu %in% c(1, 2) ~ "high school",
    edu %in% c(3, 4) ~ "vocational training",
    edu %in% c(5, 6) ~ "some experience of university education"
  ))

edu_results <- df %>%
  group_by(edu_grouped) %>%
  summarise(sample = n() / nrow(df) * 100)

# Settlement Size

df <- df %>%
  mutate(settlement_grouped = case_when(
    settlement_type == "City" ~ "City",
    settlement_type %in% c("Town", "Urban-type settlement", "Village") ~ "Village",
    settlement_type == "difficult to answer" ~ NA_character_
  )) %>%
  filter(!is.na(settlement_grouped))

city_results <- df %>%
  group_by(settlement_grouped) %>%
  summarise(sample = n() / nrow(df) * 100)

# Employment

df %>%
  group_by(empl) %>%
  summarise(P_g = n() / nrow(df) * 100)

df <- df %>%
  mutate(empl_grouped = case_when(
    empl == "Учащийся, студент, аспирант" ~ "Student",
    empl %in% c("Не работаю и ищу работу", "Не работаю и не ищу работу") ~ "Unemployed",
    empl %in% c("Пенсионер (неработающий) по старости/выслуге лет", "Пенсионер (неработающий) по инвалидности") ~ "Pensioner",
    empl == "Веду домашнее хозяйство, ухаживаю за ребенком" ~ "Housework or parental / maternal leave",
    TRUE ~ "Employed"
  ))

empl_results <- df %>%
  group_by(empl_grouped) %>%
  summarise(sample = n() / nrow(df) * 100) %>%
  arrange(factor(empl_grouped, levels = c("Employed", "Student", "Pensioner", "Unemployed", "Housework or parental / maternal leave")))

# Income

df <- df %>%
  mutate(income_grouped = case_when(
    income_subj == "Нам не хватает денег даже на питание" ~ "Cannot afford food",
    income_subj == "Нам хватает денег на питание, но не хватает на одежду" ~ "Can afford food, but cannot afford clothes",
    income_subj == "Нам хватает денег на питание и одежду, покупка более дорогих вещей, таких как телевизор или холодильник, вызывает у нас проблемы" ~ "Can afford food and clothes, but cannot afford appliances",
    income_subj == "Мы можем покупать некоторые дорогие вещи, такие как холодильник или телевизор, но не можем купить автомобиль" ~ "Can afford appliances, but cannot afford a car",
    income_subj == "Мы можем купить автомобиль, но не можем сказать, что не стеснены в средствах" ~ "Can afford anything except for an apartment",
    income_subj == "Мы можем ни в чем себе не отказывать" ~ "Can afford an apartment",
    income_subj == "Затрудняюсь ответить" ~ NA_character_
  )) %>%
  filter(!is.na(income_grouped))

income_results <- df %>%
  group_by(income_grouped) %>%
  summarise(sample = n() / nrow(df) * 100) %>%
  arrange(factor(income_grouped, levels = c(
    "Cannot afford food",
    "Can afford food, but cannot afford clothes",
    "Can afford food and clothes, but cannot afford appliances",
    "Can afford appliances, but cannot afford a car",
    "Can afford anything except for an apartment",
    "Can afford an apartment"
  )))

# Merge 

age_soc_dem_result <- age_soc_dem_result %>% rename(sample = value)
gender_results <- gender_results %>% rename(category = gender_label)
edu_results <- edu_results %>% rename(category = edu_grouped)
city_results <- city_results %>% rename(category = settlement_grouped)
empl_results <- empl_results %>% rename(category = empl_grouped)
income_results <- income_results %>% rename(category = income_grouped)

soc_dem <- bind_rows(age_soc_dem_result, gender_results, edu_results, city_results, empl_results, income_results)

# TABLE C1

soc_dem 
str(soc_dem)

```

```{r pressure, echo=FALSE}

# C2. REGIONAL VARIATION: TABLE C2 IN THE APPENDIX

region <- df %>%
    select (region) %>%
    group_by(region) %>%
    summarise (n = n()) %>%
    mutate (perc = n/sum(n)*100)

region <- subset(region, select = -c(2))
region <- region[-c(85), ] 

# TABLE C2

region
str(region)


```

```{r}
cat("\n=== LOG END ===\n")
cat("Time: ", format(Sys.time()), "\n", sep = "")

flush(log_con)

# ===== STOP LOG =====
sink(type = "message")
sink(type = "output")
close(log_con)
```

